"The deployments to Afghanistan have been one of the longest running in our history, and I wish to acknowledge the 10 New Zealanders who lost their lives in the line of duty, and the more than 3500 NZDF and other agency personnel whose commitment to replace conflict with peace will always be remembered."
Foreign Affairs Minister Nanaia Mahuta said that although the environment remained complex, the intra-Afghan peace process affords Afghanistan the best prospect of an enduring political solution.
"New Zealand will continue to be supportive of the Afghan Government and its people in the years to come, including as they work through the intra-Afghan peace process in an effort to resolve the decades-long conflict."
New Zealand deployed the SAS in 2001 and Willie Apiata later won the Victoria Cross.
The biggest deployment occurred when New Zealand led a Provincial Reconstruction Team in Bamiyan province.
Defence Minister Peeni Henare said New Zealand with its partners had helped to establish the conditions for the current intra-Afghan peace process.
"We've supported regional security, and helped to improve the lives of the people of Afghanistan, particularly in Bamiyan Province.
"Another important element of New Zealand's support for Afghanistan has been our contribution to training and mentoring a new generation of officers in the Afghanistan Army. The success of the mentoring programme being conducted with the Afghanistan National Army Officer Academy means it is now self-sufficient enough for New Zealand's contribution there to conclude."
Lieutenant Tim O'Donnell was the first NZDF death in Afghanistan in August 2010 when a patrol he was part of came under attack by insurgents near Bamiyan.
A subsequent operation to attack the insurgents, known as Operation Burnham, became the subject of a book, Hit and Run, by Nicky Hager and Jon Stephenson, alleging a cover-up over civilian casualties.
A commission of inquiry headed by former Prime Minister Sir Geoffrey Palmer and former Supreme Court judge Sir Terence Arnold was highly critical of the NZDF but found that the operation in which there were civilian casualties had been justified under international law.
Today, Commander Joint Forces New Zealand Rear Admiral Jim Gilmour said the six personnel currently in Afghanistan would return to New Zealand within the next couple of months.
Gilmour said the NZDF had made a significant contribution to regional security and development in Afghanistan over the past 20 years, including in Bamiyan province with the New Zealand Provincial Reconstruction Team.
Recently, NZDF personnel have been supporting the Nato-led mentoring for the Afghan National Army Officer Academy (Anaoa), and working at the Nato Resolute Support Mission headquarters.
NZDF mentors have been supporting the Anaoa since its creation in 2013. They have been part of an international mentoring team together with the United Kingdom, Denmark and formerly Australia and Norway.
The academy produces about 75 per cent of Afghan National Army officers. Last September, the academy graduated its 5000th cadet.
At the Nato Resolute Support Mission headquarters, NZDF personnel have been supporting women, peace and security initiatives, including in gender adviser roles.
Their work has included assisting in the development of Afghan National Army gender advisers and helping remove barriers for females in the Afghan army, including through the establishment of childcare facilities and education and training opportunities.
Gilmour said NZDF personnel, working alongside international partners, had directly contributed to the development of future Afghan military leaders.
"Our NZDF trainers and mentors have made a valuable contribution to the academy which has been developing to self-sufficiency, with our support no longer needed,'' he said.
"We are also proud to have contributed to women, peace and security initiatives in Afghanistan, and look forward to seeing further progress in Afghanistan as this work continues.
"It has been a privilege to support our Afghan partners and serve alongside them over the years."
NZDF's contribution to Afghanistan
• Ten soldiers died in Afghanistan: Lieutenant Tim O'Donnell; Private Kirifi Mila, Corporal Douglas Hughes, Lance Corporal Pralli Durrer, Lance Corporal Rory Malone, Corporal Luke Tamatea, Lance Corporal Jacinda Baker and Private Richard Harris all died in Bamiyan Province. Corporal Douglas Grant and Lance Corporal Leon Smith from NZSAS died in Kabul.
• More than 3500 NZDF personnel deployed to Afghanistan, mainly based in Bamiyan, between late 2001 and 2013.
• Four separate NZ SAS deployments.
• NZDF spent around $300 million during its commitment in Afghanistan.